<template>
  <el-tooltip :effect="$store.getters.tipTheme" content="来发图片十连" placement="left">
    <img :src="url" alt="开关不见了" @click="switchGirls">
  </el-tooltip>
</template>

<script>
import aSwitch from '../assets/switch.png'
export default {
  name: "SwitchPics",
  data() {
    return {
      url: aSwitch,
    }
  },
  methods: {
    switchGirls() {
      this.$store.dispatch('loadImages');
      this.$store.state.isSwitching = true;
      clearInterval(this.$store.state.timer);
      this.$store.state.currentIndex = 0;
      // setTimeout(() => this.$store.state.isSwitching = false, 2000);
    }
  }
}
</script>

<style scoped>
  img {
    position: fixed;
    bottom: 5%;
    right: 5%;
    cursor: pointer;
  }
</style>